From: Andrew Cooper Date: Mon, 18 Aug 2014 13:02:37 +0000 (+0100) Subject: tools/libxl: Initialise both parts of ctx->sigchld_selfpipe[] to -1 X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~4504 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success//%22http:/www.example.com/cgi/success/?a=commitdiff_plain;h=fa13f7b0c0f3d01741e35d573009503c3bf7b6a6;p=xen.git tools/libxl: Initialise both parts of ctx->sigchld_selfpipe[] to -1 Otherwise, if it is not used, libxl_ctx_free() will close fd 0. Reported-by: Alex Bligh Signed-off-by: Andrew Cooper CC: Ian Campbell CC: Ian Jackson Acked-by: Ian Campbell --- diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c index 3526539654..a1e0b5e325 100644 --- a/tools/libxl/libxl.c +++ b/tools/libxl/libxl.c @@ -71,6 +71,7 @@ int libxl_ctx_alloc(libxl_ctx **pctx, int version, ctx->childproc_user = 0; ctx->sigchld_selfpipe[0] = -1; + ctx->sigchld_selfpipe[1] = -1; libxl__ev_fd_init(&ctx->sigchld_selfpipe_efd); /* The mutex is special because we can't idempotently destroy it */